home *** CD-ROM | disk | FTP | other *** search
/ User's Choice Windows CD / User's Choice Windows CD (CMS Software)(1993).iso / windows1 / boss_sup.zip / WN_IHMSG.C < prev    next >
C/C++ Source or Header  |  1991-03-15  |  2KB  |  70 lines

  1. /*
  2. ** The Window BOSS's Data Clerk
  3. ** Copyright (c) 1988 - Philip A. Mongelluzzo
  4. ** All rights reserved.
  5. **
  6. ** wn_ihmsg - field input help message handler 
  7. **
  8. ** Copyright (c) 1988 - Philip A. Mongelluzzo
  9. ** All rights reserved.
  10. **
  11. */
  12.  
  13. #include "winboss.h"                    /* standard stuff */
  14.  
  15. /*
  16. ************
  17. * wn_ihmsg *
  18. ************
  19. */
  20.  
  21. /*
  22. ** wn_ihmsg(msg)
  23. **
  24. **    (char *)   msg - pointer to message to be displayed.
  25. **
  26. ** RETURNS:
  27. **
  28. **    NULL if error, else TRUE
  29. **
  30. ** NOTES:
  31. **
  32. **  This routine should be modified or replaced with code to suit
  33. **  your the applications specific needs.  It hooks to wn_input
  34. **  such that whenever the F1 key is pressed wn_input calls wn_ihmsg
  35. **  to display a help message for the field in question.  The hooks
  36. **  in wn_input are of the form:
  37. **
  38. **      if(key_struck == F1) wn_ihmsg;
  39. **
  40. **  This routine displays a single line of help on the last display line 
  41. **  and waits for a key to be struck before returning.
  42. **
  43. **  The help message can be a maximum of 80 characters, and must
  44. **  not contain any formatting directives (\n\t...).
  45. **
  46. */
  47.  
  48. /*
  49. ************
  50. * wn_ihmsg *
  51. ************
  52. */
  53.  
  54. wn_ihmsg(msg)                           /* field input help message */
  55. char *msg;                              /* the message to display */
  56. {
  57. WINDOWPTR wn;                           /* a window for me */
  58.  
  59.   if(!strlen(msg)) return(TRUE);        /* no message - just return */
  60.   if(strlen(msg) > 80) return(NULL);    /* dont be foolish */
  61.   wn=wn_open(1000,(wni_mxrows-1),0,(int)strlen(msg),1,(RVIDEO),NVIDEO);
  62.   if(!wn) return(NULL);                 /* Huh??? */
  63.   wn_puts(wn,0,0,msg);                  /* display message */
  64.   v_getch();                            /* fetch response */
  65.   wn_close(wn);                         /* make message go away */
  66.   return(TRUE);                         /* all done */
  67. }
  68.  
  69. /* End */
  70.